“Streaming X-Path Evaluation” is a technique used to evaluate the results of an xpath based query over an XML document. For example, a query of the form, “Find all nodes matching the xpath expression ‘/a/b/c’ in document xyz.xml,” can be evaluated using streaming xpath evaluation. To evaluate a query using streaming xpath evaluation, a linear scan is performed on the entire XML document, keeping track of state information in order to compute the required results.
Specifically, streaming xpath evaluation engines process or “stream” the entire XML document, looking for nodes that match the given xpath expression. A state machine is used to keep track of the current location inside the XML document. If the current location matches the given xpath, then a result node is added to the result set.
The streaming xpath evaluation engine may traverse the entire document each time a query is evaluated, regardless of the input path expression. The process of traversing the entire document is highly inefficient if the input XML document is a large document, consisting of large subtrees that do not match the given xpath.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.